# Contributor: Lauren N. Liberda <lauren@selfisekai.rocks>
# Maintainer: Lauren N. Liberda <lauren@selfisekai.rocks>
pkgname=octoprint-pisupport
pkgver=2023.7.31
pkgrel=0
pkgdesc="OctoPrint plugin that provides additional information about your Pi in the UI"
url="https://github.com/OctoPrint/OctoPrint-PiSupport"
arch="noarch"
license="AGPL-3.0-only"
depends="octoprint"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-ddt py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/OctoPrint/OctoPrint-PiSupport/archive/refs/tags/$pkgver/OctoPrint-PiSupport-$pkgver.tar.gz"
builddir="$srcdir/OctoPrint-PiSupport-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages testenv
	testenv/bin/python3 -m installer .dist/*.whl
	testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
6c04c1246071a9778e6e97c65ece59f05daeea7438b215db93134afc40e9ee0ca44c265980796d1143e2fd5b24e095a685beda0ff72309749012b917f0467699  OctoPrint-PiSupport-2023.7.31.tar.gz
"
